f = file('data/ChatRules.txt', 'r')
lines = f.read().replace('"', '\\"')
f.close()

f = file('data/ChatRules.inl', 'w+')
f.write('const char *chatRules = "')
for s in lines.split('\n'):
    s = s.strip()
    if len(s) == 0 or s.startswith('#'):
        continue
    f.write('%s\\n' % s)
f.write('";')
f.close()
